package com.chenc.javathreads.controlleraop.service.impl;

import cn.hutool.core.convert.Convert;
import com.chenc.javathreads.controlleraop.dto.InterfaceLogDto;
import com.chenc.javathreads.controlleraop.dto.OperateApiLogDto;
import com.chenc.javathreads.controlleraop.dto.OperationLogDto;
import com.chenc.javathreads.controlleraop.service.IOperateApiLogService;
import com.chenc.javathreads.controlleraop.service.OperationLogService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @ClassName
 * @Describtion:
 * @Author:Chenc
 * @Date:2023/12/17 17:24
 * @Version 1.0
 */
@Service
@Slf4j
public class OperationLogServiceImpl implements OperationLogService {

    @Autowired
    IOperateApiLogService operateApiLogService;

    @Override
    public void save(OperationLogDto operationLog) {
        log.info("operationLog save success,{}", operationLog);
    }

    @Override
    public void save(InterfaceLogDto interfaceLogDto) {
        OperateApiLogDto convert = Convert.convert(OperateApiLogDto.class, interfaceLogDto);
        operateApiLogService.saveEntity(convert);
//        log.info("interfaceLogDto save success,{}", interfaceLogDto);
    }
}
